package site.licoded.eureka;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
import org.springframework.core.env.Environment;

@EnableEurekaServer
@SpringBootApplication
public class EurekaApplication {
    private static final Logger LOG  = LoggerFactory.getLogger(EurekaApplication.class);
    public static void main(String[] args) {
        Environment env = SpringApplication.run(EurekaApplication.class, args).getEnvironment();
        LOG.info("启动成功！！");
        LOG.info("{}地址：\thttp://{}:{}{}"
                ,env.getProperty("spring.application.name")
                ,env.getProperty("licoded."+env.getProperty("spring.application.name")+".address")
                ,env.getProperty("server.port")
                ,env.getProperty("server.servlet.context-path")==null?"":env.getProperty("server.servlet.context-path"));
    }

}
